package sparrowGui.components
{
	import flash.display.DisplayObjectContainer;
	import flash.events.Event;
	
	/**
	 * 富文本的提示工具,相比toolTip增加了表情功能
	 * @author Pelephone
	 * @website http://cnblogs.com/pelephone
	 */
	public class SRichToolTip extends SToolTip
	{
		/**
		 * 表情文本控件
		 */
		private var _richTxt:SRichTextField;
		
		/**
		 * 构造富文本提示工具
		 * @param showParent 用于显示提示窗的父类
		 * @param uiVars 皮肤变量
		 */
		public function SRichToolTip(showParent:DisplayObjectContainer, uiVars:Object=null)
		{
			super(showParent, uiVars);
			_richTxt = new SRichTextField(txtTip);
		}
		
/*		override protected function create(uiVars:Object=null):void
		{
			super.create(argSkin);
			_richTxt = new RichTextField(txtTip,skin as Sprite);
		}*/
		
		override public function update(data:Object):void
		{
			richTxt.htmlText = String(data);
			draw();
			dispatchEvent(new Event(TIPS_UPDATA));
		}
		
		/**
		 * 注册表情类
		 * @param tClass
		 * @param name
		 */
		public function registerClass(tClass:Class,name:String):void
		{
			_richTxt.registerClass(tClass,name);
		}

		/**
		 * 富文本
		 */
		public function get richTxt():SRichTextField
		{
			return _richTxt;
		}
	}
}